#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    int n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    if(k*2>n)
    {
        cout<<"NO"<<endl;
        return ;
    }
    int a=0,b=0;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='0')a++;
        else b++;
    }
    int x=n/2-k;
    if(a>=x&&b>=x&&(a-x)%2==0&&(b-x)%2==0)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}
signed main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int T=1;
    cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}